﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Evpo.ContactData.Common;

namespace Evpo.ContactData.Data
{
    public class Contact : DataObject, IContact
    {

        #region Properties

        internal override int PrimaryKeyValue
        {
            get { return ContactID; }
            set { ContactID = value; }
        }

        public int ContactID
        {
            get;
            set;
        }

        public int TitleID
        {
            get;
            set;
        }

        public string FirstName
        {
            get;
            set;
        }

        public string LastName
        {
            get;
            set;
        }

        public bool IsMale
        {
            get;
            set;
        }

        public string Email
        {
            get;
            set;
        }

        public string HomePhone
        {
            get;
            set;
        }

        public string MobilePhone
        {
            get;
            set;
        }

        public string BusinessPhone
        {
            get;
            set;
        }

        public bool IsDeceased
        {
            get;
            set;
        }

        public int? AddressID
        {
            get;
            set;
        }

        public DateTime? DateOfBirth
        {
            get;
            set;
        }

        public int MaritalStatus
        {
            get;
            set;
        }

        public int HomeTown
        {
            get;
            set;
        }

        public int ContactInterest
        {
            get;
            set;
        }

        public int MembershipType
        {
            get;
            set;
        }

        public int MailFormat
        {
            get;
            set;
        }

        public bool PrimaryMailRecipient
        {
            get;
            set;
        }
        #endregion Properties

        #region Methods
        internal override void FillParametersToSave(List<System.Data.SqlClient.SqlParameter> paramList)
        {
            if (paramList == null)
                throw new ArgumentNullException("paramList");

            ContactAdapter.FillContactParametersToSave(this, paramList);
        }

        internal override void FillFieldsFromReader(ProcedureOutputReader procReader)
        {
            ContactAdapter.FillFieldsFromReader(this, procReader);
        }
        #endregion
    }
}
